<script src="../router/index.js"></script>
<template>
  <el-container class="layout-container">
    <!-- 左侧菜单 -->
    <el-aside width="240px" class="sidebar">
      <div class="logo">
        <h3>管理系统</h3>
      </div>
      <el-menu
        :default-active="$route.path"
        class="nav-menu"
        background-color="#2c3e50"
        text-color="#bdc3c7"
        active-text-color="#ffffff"
        router>

        <el-menu-item index="/pbgl/zyks/list">
          <i class="el-icon-s-data"></i>
          <span slot="title">专业科室排版管理</span>
        </el-menu-item>

        <el-menu-item index="/pbgl/zyjs/list">
          <i class="el-icon-s-data"></i>
          <span slot="title">专业技术系统排版管理</span>
        </el-menu-item>

        <el-menu-item index="/pbgl/jjbjl/list">
          <i class="el-icon-s-data"></i>
          <span slot="title">交接班记录</span>
        </el-menu-item>

        <el-menu-item index="/pbgl/czjl/list">
          <i class="el-icon-s-data"></i>
          <span slot="title">操作记录</span>
        </el-menu-item>

<!--        <el-menu-item index="/yxzb/list">-->
<!--          <i class="el-icon-s-data"></i>-->
<!--          <span slot="title">运行指标查询</span>-->
<!--        </el-menu-item>-->

<!--        <el-menu-item index="/gzyctb">-->
<!--          <i class="el-icon-s-data"></i>-->
<!--          <span slot="title">预测情况分析填报</span>-->
<!--        </el-menu-item>-->

<!--        <el-menu-item index="/gzpbtb">-->
<!--          <i class="el-icon-s-data"></i>-->
<!--          <span slot="title">过载配变明细填报</span>-->
<!--        </el-menu-item>-->

<!--        <el-menu-item index="/gzdytb">-->
<!--          <i class="el-icon-s-data"></i>-->
<!--          <span slot="title">低电压台区预测明细填报</span>-->
<!--        </el-menu-item>-->

<!--        <el-menu-item index="/gzzhcx">-->
<!--          <i class="el-icon-s-data"></i>-->
<!--          <span slot="title">配变重过载综合查询</span>-->
<!--        </el-menu-item>-->
      </el-menu>
    </el-aside>

    <!-- 右侧内容区域 -->
    <el-container>
      <!-- 顶部标题栏 -->
      <el-header class="header">
        <h2>{{ $route.meta.title || '页面标题' }}</h2>
        <div class="header-actions">
          <el-dropdown>
            <span class="el-dropdown-link">
              管理员<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>个人中心</el-dropdown-item>
              <el-dropdown-item divided>退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div>
      </el-header>

      <!-- 内容区域 -->
      <el-main class="main-content">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: 'Layout'
}
</script>

<style scoped>
.layout-container {
  height: 100vh;
}

/* 左侧菜单样式 */
.sidebar {
  background-color: #2c3e50;
}

.logo {
  padding: 20px;
  border-bottom: 1px solid #34495e;
  text-align: center;
  background-color: #2c3e50;
}

.logo h3 {
  margin: 0;
  color: #ecf0f1;
  font-size: 18px;
}

.nav-menu {
  border: none;
}

.nav-menu .el-menu-item {
  height: 50px;
  line-height: 50px;
}

.nav-menu .el-menu-item:hover {
  background-color: #34495e !important;
}

.nav-menu .el-menu-item.is-active {
  background-color: #409EFF !important;
}

.nav-menu .el-menu-item i {
  margin-right: 8px;
}

/* 顶部标题栏样式 */
.header {
  background-color: white;
  border-bottom: 1px solid #e4e7ed;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.header h2 {
  margin: 0;
  font-size: 20px;
  color: #2c3e50;
}

.header-actions {
  display: flex;
  align-items: center;
}

.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
  font-size: 14px;
}

.el-dropdown-link:hover {
  color: #66b1ff;
}

/* 主要内容区域样式 */
.main-content {
  background-color: #f5f5f5;
  padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    width: 200px !important;
  }

  .header {
    padding: 0 16px;
  }

  .header h2 {
    font-size: 18px;
  }

  .main-content {
    padding: 16px;
  }
}

@media (max-width: 576px) {
  .layout-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100% !important;
    height: auto;
  }

  .nav-menu .el-menu-item {
    height: 40px;
    line-height: 40px;
  }

  .header {
    padding: 0 12px;
  }

  .header h2 {
    font-size: 16px;
  }

  .main-content {
    padding: 12px;
  }
}
</style>
